Skip to content

Rename the named-array types to an AbstractITensor{DimName} hierarchy#164

Merged
mtfishman merged 3 commits into
mainfrom
mf/rename-itensor-hierarchy
Jun 19, 2026
Merged

Rename the named-array types to an AbstractITensor{DimName} hierarchy#164
mtfishman merged 3 commits into
mainfrom
mf/rename-itensor-hierarchy

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Renames the absorbed named-array types to the ITensor hierarchy: AbstractNamedDimsArray becomes AbstractITensor, NamedDimsArray becomes ITensor, AbstractNamedDimsOperator becomes AbstractITensorOperator, and NamedDimsOperator becomes ITensorOperator. The source files are renamed to match.

AbstractITensor is now parameterized only by its dimension-name type: AbstractITensor{DimName} <: AbstractArray{Any, Any}. ITensor stores its parent as an AbstractArray field and its names as a Vector{DimName}, so element type, rank, and parent array type are erased from the signature. A value still carries them, so ndims, denamedtype, and parenttype return the concrete answer for an instance and the erased one for the type. dimnametype returns the dimension-name type, and the unparameterized ITensor returns Any, mirroring eltype(Array).

The AbstractArray supertype is kept for now so existing array machinery keeps working, and will be dropped in a follow-up. Index stays its own type. The LittleSet dimension-name accessor is unchanged: dimnames still returns a LittleSet over a Tuple, with the underlying Vector{DimName} storage as an implementation detail.

Renames the absorbed named-array types: AbstractNamedDimsArray to
AbstractITensor, NamedDimsArray to ITensor, AbstractNamedDimsOperator to
AbstractITensorOperator, and NamedDimsOperator to ITensorOperator.

AbstractITensor is now parameterized only by its dimension-name type, with
element type and rank erased from the signature.
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.80000% with 111 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.07%. Comparing base (b1a7e91) to head (3ca5ba7).

Files with missing lines Patch % Lines
src/abstractitensor.jl 77.46% 89 Missing ⚠️
src/itensoroperator.jl 71.87% 9 Missing ⚠️
src/broadcast.jl 69.23% 4 Missing ⚠️
src/itensor.jl 73.33% 4 Missing ⚠️
src/tensoralgebra.jl 87.09% 4 Missing ⚠️
...t/ITensorBaseMooncakeExt/ITensorBaseMooncakeExt.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   73.20%   73.07%   -0.14%     
==========================================
  Files          23       22       -1     
  Lines        1168     1166       -2     
==========================================
- Hits          855      852       -3     
- Misses        313      314       +1     
Flag Coverage Δ
docs 23.74% <21.44%> (-0.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Renames abstractnameddimsarray.jl to abstractitensor.jl, nameddimsarray.jl
to itensor.jl, and nameddimsoperator.jl to itensoroperator.jl, and updates
the includes accordingly.
The parent array type is erased from ITensor's signature, so denamedtype
and parenttype on the type return AbstractArray. An instance still carries
the parent, so the instance methods return its concrete type.
@mtfishman mtfishman changed the title [WIP] Rename the named-array types to an AbstractITensor{DimName} hierarchy Rename the named-array types to an AbstractITensor{DimName} hierarchy Jun 19, 2026
@mtfishman mtfishman marked this pull request as ready for review June 19, 2026 04:40
@mtfishman mtfishman enabled auto-merge (squash) June 19, 2026 04:40
@mtfishman mtfishman merged commit 0614329 into main Jun 19, 2026
28 checks passed
@mtfishman mtfishman deleted the mf/rename-itensor-hierarchy branch June 19, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant